testsuite: Clean up unexpected children
authorMatthias Clasen <mclasen@redhat.com>
Sat, 9 May 2020 21:31:18 +0000 (17:31 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 11 May 2020 16:19:39 +0000 (12:19 -0400)
If you call gtk_widget_set_parent on an unsuspecting
parent widget, it is your reponsibility to clean up
before the parent gets finalized.

testsuite/gtk/action.c

index a07526cbf67dc45aeb812333a479f606adb4ef36..b153d756147c12b2955c5788d4083576ea285e62 100644 (file)
@@ -335,9 +335,11 @@ test_overlap2 (void)
   g_assert_cmpint (act1, ==, 0);
   g_assert_cmpint (act2, ==, 1);
 
-  gtk_widget_destroy (text);
   g_object_unref (group1);
   g_object_unref (group2);
+
+  gtk_widget_unparent (child);
+  g_object_unref (g_object_ref_sink (text));
 }
 
 /* Test that gtk_widget_class_query_action